package de.gwtprime.client.event;

import com.google.gwt.event.shared.GwtEvent;

import de.gwtprime.client.event.handler.OrderProcessedEventHandler;
import de.gwtprime.shared.requestFactory.OrderProxy;

public class OrderProcessedEvent extends GwtEvent<OrderProcessedEventHandler>{
	
	public static Type<OrderProcessedEventHandler> TYPE = new Type<OrderProcessedEventHandler>(); 
	
	private OrderProxy order;
	
	public OrderProcessedEvent(OrderProxy order) {
		this.setOrder(order);
	}

	@Override
	protected void dispatch(OrderProcessedEventHandler handler) {
		handler.onOrderProcessed(this);
	}

	@Override
	public Type<OrderProcessedEventHandler> getAssociatedType() {
		return TYPE;
	}

	public OrderProxy getOrder() {
		return order;
	}

	public void setOrder(OrderProxy order) {
		this.order = order;
	}


}
